package nl.hu.modellingengine.menu.client.activity;

import nl.hu.modellingengine.client.ClientFactory;
import nl.hu.modellingengine.client.place.InitPlace;
import nl.hu.modellingengine.menu.client.MenuFactory;
import nl.hu.modellingengine.menu.client.view.MenuView;

import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;

public class MenuInitActivity extends AbstractActivity implements MenuView.Presenter {
	
	private ClientFactory clientFactory;
	private MenuFactory menuFactory;
	
	public MenuInitActivity(Place place, ClientFactory clientFactory,MenuFactory menuFactory){
		this.clientFactory = clientFactory;
		this.menuFactory = menuFactory;
	}

	@Override
	public void start(AcceptsOneWidget containerWidget, EventBus eventBus) {
		MenuView menuView = menuFactory.getMenuView();
		menuView.setPresenter(this);
		containerWidget.setWidget(menuView);

	}

	@Override
	public void goTo(Place place) {
		clientFactory.getPlaceController().goTo(place);
	}

}
